/*
** ############################################################################
**     Project   : osdee - Operative Systems Design for Embedded Envrionments
**     File      : OS_Types.h
**     Revision  ; 1.0
**     Abstract  :
**         Scheduler specific types definitions
**
**     Copyright : 2014 Fernando Rodriguez - Victor Huidobro, 
**                 Open source with out any responsability.
**     
**     mail      : frr@gmail.com, vhuidobrog@gmail.com
** ############################################################################
*/

#ifndef _OS_TYPES_H_
#define _OS_TYPES_H_

#include "cdef.h"

#ifndef TASK
  #define   TASK(taskID)  void taskID(void) 
#endif
#define DeclareTask(taskID)   extern TASK(taskID)

#define MAX_PRIORITY      15
#define MAX_BUFFER_DEPTH  16

/*
** ===================================================================
**     Type        :  teOS_ERROR
**
**     Description :
**         Flags definition of possible errors that can be detected.
**         Normally the error code can be displayed as an OR of Flags
**         routed to one port (PORTA).
** ===================================================================
*/
typedef enum
{
E_OS_OK       = 0,
E_OS_ACCESS   = 1,
E_OS_CALLEVEL = 2,
E_OS_ID       = 3,
E_OS_LIMIT    = 4,
E_OS_NOFUNC   = 5,
E_OS_RESOURCE = 6,
E_OS_STATE    = 7,
E_OS_VALUE    = 8,
}teE_OS_ERR;

/*
** ===================================================================
**     Type        :  teOS_Task_Id
**
**     Description :
**         Enumeration of supported Tasks Ids.
** ===================================================================
*/
typedef enum
{
  OS_Task_1 = 0,
  OS_Task_2 = 1,
  OS_Task_3 = 2,
  OS_Task_4 = 3,
  OS_Task_5 = 4,
  OS_Task_6 = 5,
  OS_Task_7 = 6,
  OS_No_Task
}teOS_Task_Id;

/*
** ===================================================================
**     Type        :  teOS_Task_State
**
**     Description :
**         Status a task can have.
** ===================================================================
*/
typedef enum
{
  OS_Task_Suspended,
  OS_Task_Ready,
  OS_Task_Running,
  OS_Task_Waiting
}teOS_Task_State;

typedef  teOS_Task_State* te_TaskStateRef;
typedef  teOS_Task_Id*    te_TaskIdRef;

#endif /*_OS_TYPES_H_*/